<{include file="../public/header.html"}>
<style>
.menu-access{
    background:#cccccc;
}
.btn-follow{
    follow:left;
}
    </style>
      <div class="container-fluid">

        <div class="row">
            <div class="card">
            <div class="card-toolbar clearfix">
                 
                <div class="toolbar-btn-action">
                    <a class="btn btn-primary m-r-5" href="/backend/adminaccess/index"><i class="mdi mdi-keyboard-backspace"></i>返回</a>
                </div>
            </div>
            </div>

          <div class="col-md-12">
            <div class="card">
              <div class="card-header"><h4>修改权限</h4></div>
              <div class="card-body">
                
                <form id="form1" class="form-horizontal" action="" method="post" enctype="multipart/form-data" onsubmit="return submitForm();">
                <div class="form-group">
                    <label class="col-xs-12" for="access_name">名称</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="access_name" name="access_name" placeholder="" value="<{$access_name}>">
                      <div class="help-block"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12" for="access_rule">规则</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="access_rule" name="access_rule" placeholder="/backend/article/index" value="<{$access_rule}>">
                      <div class="help-block"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12" for="parent_id">父级</label>
                    <div class="col-xs-12">
                      <select class="form-control" id="parent_id" name="parent_id" size="1">
                        <option value="0">==根分类==</option>
                          <{$parent_id}>
                      </select>
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-xs-12">显示</label>
                    <div class="col-xs-12">
                      <label class="radio-inline" for="is-show-radio1">
                        <input type="radio" id="is-show-radio1" name="is_show" value="2" <{if $is_show == 1}>checked<{/if}>>
                        否
                      </label>
                      <label class="radio-inline" for="is-show-radio2">
                        <input type="radio" id="is-show-radio2" name="is_show" value="1" <{if $is_show == 2}>checked<{/if}>>
                        是
                      </label>
                    </div>
                  </div>
                  
                   <div class="form-group">
                    <div class="col-xs-12">
                      <button class="btn btn-primary" type="submit">提交</button>
                    </div>
                  </div>
                  <input type="hidden" name="access_id" value="<{$access_id}>">
                </form>
                
              </div>
            </div>
          </div>

        </div>
                
      </div>
<!--消息提示-->
<script src="/backend/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/backend/js/lightyear.js"></script>
<script type="text/javascript" src="/static/js/jquery.form.js"></script>
<script type="text/javascript">
    $(function(){
        $('.search-bar .dropdown-menu a').click(function() {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });

    function submitForm()
    {
        $("#form1").ajaxSubmit({
            type: 'post',
            url: "/backend/adminaccess/edit" ,
            success: function(data){
                var j = JSON.parse(data);
                if(j.code==1){
                    $( "#form1").resetForm();
                    lightyear.notify('操作成功，页面即将自动跳转~', 'success', 2000, 'mdi mdi-emoticon-happy', 'top', 'center');
                    setTimeout(function(){
                        location.href='/backend/adminaccess/index';
                    }, 2000)
                }else{
                    lightyear.notify(j.msg, 'danger', 500);
                }
            },
            error: function(XmlHttpRequest, textStatus, errorThrown){
                alert( "error");
            }
        });
        return false;
    }
</script>
<{include file="../public/footer.html"}>    